﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

//使资源加载方式和使用逻辑分离
//以便于支持：热更新，对象池
public class ResMgr : Singleton<ResMgr>
{

    public GameObject GetInstance(string resPath)
    {
        return GameObject.Instantiate(Resources.Load<GameObject>(resPath));
    }

    public T GetResources<T>(string resPath) where T : Object
    {
        return Resources.Load<T>(resPath);
    }

    public void Release(GameObject ui)
    {
        GameObject.Destroy(ui);
    }
}
